﻿@model IEnumerable<ChampionFramework.Models.FaseGrupo>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.QtdGrupos)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.DataInicio)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.DataFim)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Descricao)
        </th>
        <th>
            Grupos
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.QtdGrupos)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DataInicio)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DataFim)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Descricao)
        </td>
        <td>
            @foreach (var subitem in item.Grupo) {
                <span>&nbsp;</span>
                @Html.ActionLink(subitem.Nome, "Details", "Grupos", new { id = subitem.Id }, null);
            }
        </td>
        <td>            
            @Html.ActionLink("Details", "Details", new { id = item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.Id })
        </td>
    </tr>
}

</table>
